<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript" src="${webRoot}/plug-in/fancybox/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="${webRoot}/plug-in/fancybox/fancybox/jquery.fancybox-1.3.4.js"></script>
<link rel="stylesheet" type="text/css" href="${webRoot}/plug-in/fancybox/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<style type="text/css">
/*    .datagrid-cell img {
        width: 100px;
        height: 100px;
    }*/
</style>

<div id="main_ad_list" class="easyui-layout" fit="true">
    <div region="center" style="padding: 1px;">
        <t:datagrid name="adPositionList" title="" actionUrl="adController.do?adPositionGrid" fit="true" fitColumns="true">
            <t:dgCol title="common.code" field="id" hidden="true" ></t:dgCol>
            <t:dgCol title="名称" field="name" width="100"></t:dgCol>
            <t:dgCol title="代码" field="code"  width="100"></t:dgCol>
            <t:dgCol title="页面" field="page" width="100"></t:dgCol>
            <t:dgCol title="广告类型" dictionary="adType" field="type" width="100"></t:dgCol>
            <t:dgCol title="广告模板" dictionary="dyAdTem" field="templet" width="100"></t:dgCol>
            <t:dgCol title="排序" field="sort" width="50"></t:dgCol>
            <t:dgCol title="common.operation" field="opt"></t:dgCol>
            <t:dgFunOpt funname="showAdInfo(id)" title="广告信息"></t:dgFunOpt>
            <t:dgDelOpt url="adController.do?delAdPosition&id={id}" title="common.delete"></t:dgDelOpt>

            <t:dgToolBar title="新增广告" langArg="common.language" icon="icon-add" url="adController.do?addorupdateAdPosition" funname="add" width="500" height="320"></t:dgToolBar>
            <t:dgToolBar title="编辑广告" langArg="common.language" icon="icon-edit" url="adController.do?addorupdateAdPosition" funname="update" width="500" height="320"></t:dgToolBar>
        </t:datagrid>
        <%--<div id="positionListtb" style="padding: 3px; height: 25px">
            <div style="float: left;">
                <a href="#" class="easyui-linkbutton" plain="true" icon="icon-add" onclick="add('新增广告', 'adController.do?addorupdateAdPosition&id', 'adPositionList')">新增广告</a>
                <a href="#" class="easyui-linkbutton" plain="true" icon="icon-edit" onclick="update('编辑广告', 'adController.do?addorupdateAdPosition', 'adPositionList')">编辑广告</a>
            </div>
        </div>--%>
    </div>
</div>
<div data-options="region:'east',
	title:'广告信息',
	collapsed:true,
	split:true,
	border:false,
	onExpand : function(){
		li_east = 1;
	},
	onCollapse : function() {
	    li_east = 0;
	}"
     style="width: 400px; overflow: hidden;" id="eastPanel">
    <div class="easyui-panel" style="padding: 1px;" fit="true" border="false" id="adListPanel"></div>
</div>
<script type="text/javascript">
    $(function() {
        var li_east = 0;
    });
    function showAdInfo(id){
        var title = '广告信息';
     /*   if(li_east == 0 || $('#main_ad_list').layout('panel','east').panel('options').title != title){
            $('#main_ad_list').layout('expand','east');
        }

        $('#main_ad_list').layout('panel','east').panel('setTitle', title);
        $('#main_ad_list').layout('panel','east').panel('resize', {width: 600});
        $('#adListPanel').panel("refresh", "adController.do?ad&pid=" + id);*/
        if(li_east == 0){
            $('#main_ad_list').layout('expand','east');
        }
        $('#main_ad_list').layout('panel','east').panel('setTitle', title);
        $('#main_ad_list').layout('panel','east').panel('resize', {width: 600});
        $('#adListPanel').panel("refresh", "adController.do?ad&pid=" + id);

    }
</script>